public class 支配模式 {
    public static void main(String[] args)
    {
        String result=new Adapter(new Speaker()).translate();
    }
}
//讲话
class Speaker {
    public String speak()
    {
        System.out.println("I am a speaker");
        return "I am a speaker";
    }

}
//适配讲话
interface Translator{
    public String translate();
}
class Adapter implements Translator{
    private Speaker speaker;
    public Adapter(Speaker speaker)
    {
        this.speaker = speaker;
    }


    @Override
    public String translate() {
        String result =  speaker.speak();
        //手语翻译
        return result;


    }
}